package com.lovi.product.controller;

import com.lovi.pojo.Product;
import com.lovi.product.service.ProductService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 专门为搜索服务设置的controller
 */
@RestController
@RequestMapping("/product")
public class ProductSearchController {
    @Autowired
    private ProductService productService;

    /**
     * 查询全部商品信息,供search服务更新
     * @return
     */
    @GetMapping("/list")
    public List<Product> list(){

        return productService.list();
    }
}
